package com.jt.service.impl;

import com.jt.dao.CategoryMapper;
import com.jt.entity.Category;
import com.jt.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public Category queryById(Integer id) {
        return categoryMapper.queryById(id);
    }

    @Override
    public Integer save(Category category) {
        return categoryMapper.save(category);
    }

    @Override
    public Integer update(Category category) {
        return categoryMapper.updateStatus(category);
    }

    @Override
    public Integer updateStatus(Category category) {
        return categoryMapper.updateStatus(category);
    }

    @Override
    public List<Category> queryAll() {
        return categoryMapper.queryAll();
    }

    @Override
    public List<Category> queryByName(String activity) {
        return categoryMapper.queryByName(activity);
    }
}
